<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- creator-external-tools.qdoc -->
  <title>Using External Tools | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Using External Tools</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="creator-keyboard-shortcuts.html" />
  <link rel="next" href="creator-task-lists.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="creator-keyboard-shortcuts.html">Keyboard Shortcuts</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-task-lists.html">Showing Task List Files in Issues Pane</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#using-qt-linguist">Using Qt Linguist</a></li>
<li class="level1"><a href="#previewing-qml-files">Previewing QML Files</a></li>
<li class="level1"><a href="#using-external-text-editors">Using External Text Editors</a></li>
<li class="level1"><a href="#configuring-external-tools">Configuring External Tools</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Using External Tools</h1>
<span class="subtitle"></span>
<!-- $$$creator-editor-external.html-description -->
<div class="descr"> <a name="details"></a>
<p>You can use external tools directly from Qt Creator. Qt Linguist, QML preview tools, and the default text editor for your system are preconfigured for use. You can change their default configurations and configure new tools.</p>
<p>To run the tools, select <b>Tools</b> &gt; <b>External</b>, or use the <code>x</code> filter in the locator.</p>
<a name="using-qt-linguist"></a>
<h2 id="using-qt-linguist">Using Qt Linguist</h2>
<p>You can use the Qt Linguist release manager tools, lupdate and lrelease, directly from Qt Creator. The lupdate tool is used to synchronize source code and translations. The lrelease tool is used to create run-time translation files for use by the released application.</p>
<p>When you <a href="creator-project-creating.html">create a new project</a>, you can automatically generate a translation source file (TS) for one language. You can add other languages later by editing the project file.</p>
<p>To synchronize TS files from a translator with the application code, select <b>Tools</b> &gt; <b>External</b> &gt; <b>Linguist</b> &gt; <b>Update Translations (lupdate)</b>.</p>
<p>To generate from the TS files Qt message (QM) files that can be used by an application, select <b>Tools</b> &gt; <b>External</b> &gt; <b>Linguist</b> &gt; <b>Release Translations (lrelease)</b>.</p>
<p>By default, the project .pro file is passed to the tools as an argument. To specify other command line arguments for the tools, select <b>Tools &gt; External &gt; Configure</b>.</p>
<p>To open TS files in Qt Linguist, right-click a TS file in the <b>Projects</b> or <b>File System</b> view and select <b>Open With</b> &gt; <b>Qt Linguist</b> in the context menu. For more information about Qt Linguist, see <a href="http://doc.qt.io/qt-5/qtlinguist-index.html">Qt Linguist Manual</a>.</p>
<a name="previewing-qml-files"></a>
<h2 id="previewing-qml-files">Previewing QML Files</h2>
<p>You can preview the current QML document in the QML Viewer (Qt Quick 1) or QML Scene (Qt Quick 2). The preview tools enable you to load QML documents for viewing and testing while you are developing an application.</p>
<p>To preview the currently active QML file, select <b>Tools</b> &gt; <b>External</b> &gt; <b>Qt Quick</b> &gt; <b>Qt Quick 1 Preview (qmlviewer)</b> or <b>Qt Quick 2 Preview (qmlscene)</b>.</p>
<a name="using-external-text-editors"></a>
<h2 id="using-external-text-editors">Using External Text Editors</h2>
<p>You can open files for editing in the default text editor for your system: Notepad on Windows and vi on Linux and <a href="nolink">macOS</a>. To open the file you are currently viewing in an external editor, select <b>Tools</b> &gt; <b>External</b> &gt; <b>Text</b> &gt; <b>Edit with Notepad</b> or <b>Edit with vi</b>, depending on your system.</p>
<p>Qt Creator looks for the editor path in the PATH environment variable of your operating system.</p>
<a name="configuring-external-tools"></a>
<h2 id="configuring-external-tools">Configuring External Tools</h2>
<p>You can change the configuration of preconfigured tools and configure additional tools in Qt Creator <b>Options</b>.</p>
<p class="centerAlign"><img src="images/qtcreator-external-tools.png" alt="" /></p><p>To configure external tools:</p>
<ol class="1" type="1"><li>Select <b>Tools &gt; External &gt; Configure</b>.</li>
<li>Select <b>Add &gt; Add Tool</b> to add a new tool. You can also select <b>Add Category</b> to add a new category.</li>
<li>In the <b>Executable</b> field, specify the executable to run. If the executable is found in your system PATH variable, do not specify the path to it.</li>
<li>In the <b>Arguments</b> field, specify optional arguments for running the executable.</li>
<li>In the <b>Working directory</b> field, specify the path to the working directory.</li>
<li>In the <b>Output</b> field, select how to handle output from the tool. You can ignore the output, view it in the <b>General Messages</b> output pane, or replace the selected text with the output in the code editor.</li>
<li>In the <b>Error output</b> field, select how to handle error messages from the tool.</li>
<li>In the <b>Base environment</b> field, select whether to run the tool in the system environment or the <a href="creator-build-settings.html#build-environment">build environment</a> or <a href="creator-run-settings.html#selecting-the-run-environment">run environment</a> of the active project. Select the build or run environment if the system environment does not contain the necessary PATH settings to find the tool chain, for example.</li>
<li>In the <b>Environment</b> field, select <b>Change</b> to modify environment variable values for build and run environments in the <b>Edit Environment Changes</b> dialog. For more information about how to add and remove variable values, see <a href="creator-build-settings.html#batch-editing">Batch Editing</a>.</li>
<li>Select the <b>Modifies current document</b> check box to make sure that if the current document is modified by the tool, it is saved before the tool is run and reloaded after the tool finishes.</li>
<li>In the <b>Input</b> field, specify text that is passed as standard input to the tool.</li>
</ol>
<p>The category and tool are added to the <b>Tools &gt; External</b> menu.</p>
<p>If you change the configuration of preconfigured tools, you can later revert the changes by selecting the <b>Reset</b> button.</p>
<p>The tool configurations that you add and modify are stored in XML format in the user configuration folder. For example, <code>~/config/QtProject/qtcreator/externaltools</code> on Linux and <a href="nolink">macOS</a> and <code>C:\Users\username\AppData\Roaming\QtProject\qtcreator\externaltools</code> in Windows. To share a configuration with other users, copy an XML configuration file to the folder.</p>
</div>
<!-- @@@creator-editor-external.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="creator-keyboard-shortcuts.html">Keyboard Shortcuts</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-task-lists.html">Showing Task List Files in Issues Pane</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
